All Functions of Week 1

c

{base}

Combine values/vectors into a vector

ifelse

{base}

Return a or b depending on the value of test

rbind

{base}

Combine R objects by rows

ncol

{base}

Get number of columns of a data frame

names

{base}

Retrieve names of a list/vector

sd

{stats}

Get standard deviation of a vector

ls.str

{utils}

Similarly to ls, with a print() method that calls str() on each object

plot

{graphics}

Generic function from base R to produce a plot

cbind

{base}

Combine R objects by columns

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

dim

{base}

Get dimensions of a data frame

class

{base}

Retrieve class of an R object

attach

{base}

Attach Set of R Objects to Search Path

View

{base}

View a data frame

nrow

{base}

Get number of rows of a data frame

read.spss

{foreign}

Read a .sav file (SPSS data)

mean

{base}

Get mean of a vector

library

{base}

Load an R package

str

{utils}

Get the structure of an R object

head

{utils}

Show first 5 rows of a data frame

setwd

{base}

Set Working Directory

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

The end!